package org.ipb.controller.modul.skkeputusan;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.ipb.model.SKKeputusan;

import util.hibernate.DAO;

import com.opensymphony.xwork2.ActionSupport;

public class ActionJsonMap extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private Map<Integer, String> listSKKeputusan = new HashMap<Integer, String>();

	// private List<SKKeputusan> listSKKeputusan;
	@SuppressWarnings("unchecked")
	public String execute() {
		DAO<Integer> dao = new DAO<Integer>();
		List<SKKeputusan> list = (List<SKKeputusan>) dao
				.findAll(SKKeputusan.class);

		for (SKKeputusan f : list) {
			listSKKeputusan.put(f.getId(),
					f.getInisial() + " " + f.getLembagaPembuatKeputusan());
		}
		dao.close();
		return SUCCESS;
	}

	public Map<Integer, String> getListSKKeputusan() {
		return listSKKeputusan;
	}

	public void setListSKKeputusan(Map<Integer, String> listSKKeputusan) {
		this.listSKKeputusan = listSKKeputusan;
	}

}
